<template>
    <div class="mui-numbox" data-numbox-min='1' data-numbox-max='max'>
					<button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
					<input id="test" class="mui-input-numbox" type="number" value="1" />
					<button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
	</div>
</template>

<script>
//导入mui，支持数字框
import mui from "../../lib/mui/js/mui.js"
export default {
    data(){
        return{};
    },

    mounted(){
        //当组件挂载到页面后，初始化数字框
        mui(".mui-numbox").numbox();
    },
    props:["max"],
        //接收父组件传递的
    watch:{
        max:function(newval,oldval){
            console.log(newval)
            mui('.mui-numbox')
            .numbox()
            .setOption('max',newval)
        }
    }

};
</script>

<style>

</style>